package com.dmm.order.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dmm.order.entity.OrderDetail;
import com.dmm.order.service.OrderDetailService;
import com.dmm.result.Result;
import com.dmm.vo.order.OrderInfoQueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.lang.invoke.LambdaConversionException;
import java.util.List;

/**
 * <p>
 * 订单明细 订单明细 前端控制器
 * </p>
 *
 * @author dmm
 * @since 2022-09-18
 */
@RestController
@RequestMapping("/order/orderdetail")
@Api(tags = "订单管理接口")
@CrossOrigin
public class OrderDetailController {

    @Resource
    OrderDetailService orderDetailService;

    @ApiOperation(value = "获取分页列表")
    @GetMapping("{page}/{limit}")
    public Result index(@ApiParam(name = "page", value = "当前页码", required = true)
                            @PathVariable Long page,
                        @ApiParam(name = "limit", value = "每页记录数", required = true)
                            @PathVariable Long limit,
                        @ApiParam(name = "orderInfoVo", value = "查询对象", required = false)
                             @RequestBody   OrderInfoQueryVo orderInfoQueryVo){

        Page<OrderDetail> page1 =new Page<>(page,limit);

        return Result.success(null);
    }
    @GetMapping("/test")
    @ApiOperation("测试连接池")
    public Result testData(){
        List<OrderDetail> list = orderDetailService.list();
        return Result.success(list);
    }

}

